#ifndef _KT404A_H_
#define _KT404A_H_
#include <HardwareSerial.h>


#define KT404_CMD_LEN		10


/**
* @brief:
* KT404A control
*/
class CKT404A
{
public:
  CKT404A();
  ~CKT404A();

  void Init(HardwareSerial *serl);
  void SetVoice(uint8_t vol); // vol:1~30
  void AddVoice();
  void DecVoice();
  void Play(uint16_t idx);
  void Play(uint8_t dir, uint8_t idx); // dir:1~99,idx:1~255
  void Stop();
  void Pause();
  void Resume();

protected:
  void flushRcvBuffer();
  void checksum(uint8_t len, uint8_t *cmd);
  void writeCmd(uint8_t len, uint8_t *cmd);
  
protected:
  HardwareSerial *m_serlPtr;
};

#endif


